

package jetbrains.buildServer.server.graphql.model.connections;

import graphql.execution.DataFetcherResult;
import graphql.relay.PageInfo;
import java.util.List;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface ExtensibleConnection<T, E extends ExtensibleConnection.Edge<T>> {
  @NotNull
  DataFetcherResult<List<E>> getEdges();

  @Nullable
  default PageInfo getPageInfo() {
    return null;
  }

  public interface Edge<T> {
    @NotNull
    DataFetcherResult<T> getNode();

    @Nullable
    default String getCursor() {
      return null;
    }
  }
}